<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center mychakan_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub mychakan_fd0_0'>
					<view class='flex flex-wrap align-center mychakan_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  mychakan_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='mychakan_fd0_0_c1_c0'>我的查看</text>
					</view>
					<view class='flex flex-wrap align-center justify-end mychakan_fd0_0_c0'>
					</view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center">
				<view class='flex flex-wrap align-center justify-between mychakan_fd1_0' v-if="caseslog.length>0">
					<text class='mychakan_fd1_0_c0'>共有{{caseslog.length}}条内容</text>
					<view class='flex flex-wrap align-center' @click="editclick">
						<text class='mychakan_fd1_0_c1_c0' v-if="edit">管理</text>
						<text class='mychakan_fd1_0_c1_c0' v-else>完成</text>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center mychakan_fd1_1' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/shouye/anjiandetail/anjiandetail?anjianid=${item.cases_id}`" v-for="item in caseslog" v-if="edit">
					<view class='flex flex-wrap align-center justify-between mychakan_fd1_1_c0'>
						<view class='flex flex-direction align-stretch'>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c0'>
								<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c0_c0'>
								</view>
								<text style="padding-left: 8rpx;">案件号：</text>
								<text>{{item.sn}}</text>
							</view>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c1'>
								<text class='mychakan_fd1_1_c0_c0_c1_c0'>案件类型：</text>
								<text>{{item.cate_name}}</text>
							</view>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c2'>
								<text class='mychakan_fd1_1_c0_c0_c2_c0'>{{item.create_time}}提交</text>
							</view>
						</view>
						<view class='flex flex-wrap align-center justify-center mychakan_fd1_1_c0_c2' v-if="item.lose==true">
							<text class='mychakan_fd1_1_c0_c2_c0'>已失效</text>
						</view>
						<view class='flex flex-wrap align-center justify-center mychakan_fd1_1_c0_c1' v-else>
							<text class='mychakan_fd1_1_c0_c1_c0'>查看详情</text>
						</view>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center mychakan_fd1_1' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/shouye/anjiandetail/anjiandetail?aid=${item.aid}`" v-for="(item,index) in caseslog" v-if="!edit">
					<view class='flex flex-wrap align-center justify-between mychakan_fd1_1_c0'>
						<view class='flex flex-direction align-stretch'>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c0' @click.stop="checkclick(index)">
								<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/75.png" mode="" v-if="item.checked==true"></image>
								<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/76.png" mode="" v-else></image>
								<text style="padding-left: 24rpx;">案件号：</text>
								<text>{{item.sn}}</text>
							</view>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c1'>
								<text class='mychakan_fd1_1_c0_c0_c1_c0' style="padding-left:32rpx;">案件类型：</text>
								<text>{{item.cate_name}}</text>
							</view>
							<view class='flex flex-wrap align-center mychakan_fd1_1_c0_c0_c2'>
								<text class='mychakan_fd1_1_c0_c0_c2_c0' style="padding-left: 32rpx;">{{item.create_time}}提交</text>
							</view>
						</view>
						<view class='flex flex-wrap align-center justify-center mychakan_fd1_1_c0_c2' v-if="item.lose==true">
							<text class='mychakan_fd1_1_c0_c2_c0'>已失效</text>
						</view>
						<view class='flex flex-wrap align-center justify-center mychakan_fd1_1_c0_c1' v-else>
							<text class='mychakan_fd1_1_c0_c1_c0'>查看详情</text>
						</view>
					</view>
				</view>
				<view class="noshuju" v-if="caseslog.length==0">
					<image src="../../../static/empty/order.png" mode=""></image>
				</view>
				<view class='flex align-stretch mychakan_fd1_2' v-if="edit==false">
					<view class='flex flex-wrap align-center mychakan_fd1_2_c0'>
						<text class='mychakan_fd1_2_c0_c0'>供选择{{checkarry.length}}件案件</text>
					</view>
					<view class='flex flex-direction align-center justify-around mychakan_fd1_2_c1' @click="del_caseslog">
						<text class='mychakan_fd1_2_c1_c0'>删除</text>
					</view>
				</view>
			</view>
			<!---flex布局flex布局结束-->
		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"caseslog": [],
				edit:true,//管理编辑切换
				checkarry:[],//选中的数据
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getyt65bb6d2e7984fFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//我的查看案例记录
			getyt65bb6d2e7984fFunc() {
				this.minixPagingListsApi = global.apiUrls.post65bb6d2e7984f;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {}
				this.listData = [];
				this.caseslog = this.listData;
				this.pagingListToggle();
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			},
			
			//切换
			editclick(){
				this.edit = !this.edit;
			},
			
			//选中事件
			checkclick(index){
				if(this.caseslog[index].checked==true){
					this.caseslog[index].checked=false;
				}else{
					this.caseslog[index].checked=true;
				}
				this.checkarry = this.caseslog.filter(item=>{
					return item.checked == true;
				}).map(list=>{
					return list.aid;
				})
				console.log(this.checkarry)
			},
			
			//删除我的查看记录
			del_caseslog(){
				let _this = this;
				if(this.checkarry.length==0){
					this.$message.info("请选择要删除的案例")
				}else{
					_this.$api.post(global.apiUrls.del_caseslog, {
						aid:_this.checkarry.toString(),
					}).then(res=>{
						if(res.data.code==1){
							_this.$message.info("删除成功")
							_this.checkarry = [];
							_this.getyt65bb6d2e7984fFunc();
						}else{
							_this.$message.info(res.data.msg)
						}
					})
				}
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}
	.noshuju{
		width: 100%;
		overflow: hidden;
	}
	.noshuju image{
		width: 300rpx;
		height: 300rpx;
		display: block;
		margin: 100rpx auto;
	}
	.mychakan_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.mychakan_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.mychakan_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.mychakan_fd0_0_c0 {
		width: 120rpx;
	}

	.mychakan_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.mychakan_fd1_2_c1_c0 {
		color: #FFFFFF;
		font-size: 28rpx;
		font-weight: 500;
	}

	.mychakan_fd1_2_c1 {
		background: rgba(38, 191, 1, 1);
		width: 290rpx;
		background-size: 100% auto;
		color: var(--benbenFontColor3);
	}

	.mychakan_fd1_2_c0_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 500;
		padding: 0rpx 0rpx 0rpx 30rpx;
	}

	.mychakan_fd1_2_c0 {
		background: #FFFFFF;
		width: 455rpx;
		height: 98rpx;
	}

	.mychakan_fd1_2 {
		border: 1px solid rgba(242, 242, 242, 1);
		width: 100%;
		height: 98rpx;
		color: #26BF01;
		font-size: 28rpx;
		font-weight: 400;
		position: fixed;
		bottom: calc(0rpx + var(--window-bottom));
		left: 0rpx;
	}

	.mychakan_fd1_1_c0_c2_c0 {
		color: #BBBBBB;
		font-size: 24rpx;
		font-weight: 400;
	}

	.mychakan_fd1_1_c0_c2 {
		background: #F5F5F5;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		width: 120rpx;
		height: 54rpx;
	}

	.mychakan_fd1_1_c0_c1_c0 {
		color: #333333;
		font-size: 24rpx;
		font-weight: 400;
	}

	.mychakan_fd1_1_c0_c1 {
		border: 1px solid #DEDEDE;
		background: #FFFFFF;
		border-radius: 8rpx;
		width: 120rpx;
		height: 54rpx;
	}

	.mychakan_fd1_1_c0_c0_c2_c0 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx 24rpx;
		
	}

	.mychakan_fd1_1_c0_c0_c2 {
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.mychakan_fd1_1_c0_c0_c1_c0 {
		text-align: center;
		
	}

	.mychakan_fd1_1_c0_c0_c1 {
		color: #1A1A1A;
		font-size: 28rpx;
		font-weight: 500;
		margin: 8rpx 0rpx 0rpx 24rpx;
	}

	.mychakan_fd1_1_c0_c0_c0_c0 {
		background: rgba(43, 108, 253, 1);
		width: 4rpx;
		height: 24rpx;
		margin: 0rpx 12rpx 0rpx 0rpx;
	}

	.mychakan_fd1_1_c0_c0_c0 {
		color: #1A1A1A;
		font-size: 28rpx;
		font-weight: 500;
	}
	.mychakan_fd1_1_c0_c0_c0 image{
		width: 32rpx;
		height: 32rpx;
	}
	.mychakan_fd1_1_c0 {
		width: 702rpx;
		height: 180rpx;
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.mychakan_fd1_1 {
		border-top: 1px solid rgba(187, 187, 187, 1);
		background: rgba(255, 255, 255, 1);
		width: 100%;
		background-size: 100% auto;
	}

	.mychakan_fd1_0_c1_c0 {
		color: #26BF01;
		font-size: 28rpx;
		font-weight: 400;
		padding: 0rpx 24rpx 0rpx 0rpx;
	}

	.mychakan_fd1_0_c0 {
		color: #999999;
		font-size: 28rpx;
		font-weight: 400;
		padding: 24rpx 0rpx 24rpx 24rpx;
	}

	.mychakan_fd1_0 {
		background: #fff;
		width: 100%;
		background-size: 100% auto;
	}
</style>